﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Facade
{
    public class EncryptFacade:IEncryptFacade
    {
        private readonly FileReader _fileReader;
        private readonly CipherMachine _cipherMachine;
        private readonly FileWriter _fileWriter;

        public EncryptFacade()
        {
            _fileReader = new FileReader();
            _cipherMachine = new CipherMachine();
            _fileWriter = new FileWriter();
        }

        public void FileEncrypt(string sourceFilePath, string targetFilePath)
        {
            Console.WriteLine("=== 开始文件加密流程 ===");

            string plainText = _fileReader.read(sourceFilePath);

            string encryptText = _cipherMachine.encrypt(plainText);

            _fileWriter.write(encryptText, targetFilePath);

            Console.WriteLine("=== 文件加密完成 ===");
        }
    }
}
